package com.yc.newcoder;

import com.yc.baseProgram.C;

import java.io.InputStream;
import java.math.BigDecimal;
import java.util.*;

/**
 * 牛客练习
 */
public class C1 {
    public static void main(String[] args) {
        C1 c = new C1();
//        c.m3();
//        c.m5();
//        c.m6();
//        c.m7();
//        c.m8();
//        c.m9();
//        c.m10();
//        c.m11();
        c.m12();


    }

    public void m1() {
        InputStream a = System.in;
        Scanner s = new Scanner(a);
        String n = s.next();
        String n1 = s.next();
        System.out.println(n);
        System.out.println(n1);

        BitSet b = new BitSet(501);
        b.set(0,true);
        String aaa = "aaa";

        Integer[] aa = {1,2};
        Arrays.sort(aa);
        Arrays.sort(aa, Collections.reverseOrder());
        Queue q = new ArrayDeque();
        List<String> list = new ArrayList<>();
//        Object[] la = list.toArray()
    }

    public void m2() {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int a = in.nextInt();
            int b = in.nextInt();
            System.out.println(a + b);
        }
    }

    public void m3() {
        InputStream a = System.in;
        Scanner s = new Scanner(a);
        String n = s.nextLine();
        String n1 = s.nextLine();
        System.out.println(n);
        System.out.println(n1);
    }

    public void m4() {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextDouble()) { // 注意 while 处理多个 case
            System.out.println(in.nextBigDecimal().setScale(0,BigDecimal.ROUND_HALF_UP).toString());

        }
    }

    public void m5() {
        Scanner in = new Scanner(System.in);
        System.out.println(in.nextInt());
        System.out.println(in.nextInt());
        System.out.println(in.nextInt());
    }

    public void m6() {
        int tip = 167969729;
        int tool = (1<<8) -1;
        System.out.println(Integer.toBinaryString(tip));
        System.out.println(Integer.toBinaryString(tool));
        System.out.println(Integer.toBinaryString(tip&tool));
        System.out.println(tip&tool);
        System.out.println(tip2ip("167969729"));

    }

    public static String tip2ip(String tip) {
        int t = Integer.parseInt(tip);
        int tool = (1<<8) -1;

        StringBuilder sb = new StringBuilder();
        for (int j=3; j>=0; j--) {
            sb.append((t>>(8*j)) & tool).append(".");
        }
        sb.setLength(sb.length()-1);

        return sb.toString();
    }

    public void m7() {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextLine()) {
            System.out.println(scanner.nextInt());
        }
    }

    public void m8() {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            int n = in.nextInt();

            Integer[] a = new Integer[n];
            for (int i=0; i<n; i++) {
                a[i] = in.nextInt();
            }
            int f = in.nextInt();

            if (f == 0) {
                Arrays.sort(a);
            } else {
                Arrays.sort(a, Collections.reverseOrder());
            }
            for(Integer t : a) {
                System.out.print(t + " ");
            }

        }
    }

    public void m9() {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
            System.out.print(sc.nextLine());
        }
    }

    //字符串排序
    public void m10() {
        Scanner in = new Scanner(System.in);

        while (in.hasNext()) {
            int n = in.nextInt();
            // System.out.println("n=" + n);
            String[] a = new String[n];
            for (int i=0; i<a.length; i++) {
                a[i] = in.next();
            }
            Arrays.sort(a, String.CASE_INSENSITIVE_ORDER);
            for (int i=0; i<a.length; i++) {
                System.out.println(a[i]);
            }
        }
    }

    public void m11() {
        String aa = "abc";
        String bb = "bac";
        char[] ac = aa.toCharArray();
        char[] bc = bb.toCharArray();
        Arrays.sort(ac);
        Arrays.sort(bc);
        System.out.println(ac);
        System.out.println(bc);
        if (ac.equals(bc)) {
            System.out.println("equals");
        }

        char[] x = {'a','b', 'c'};
        char[] y = {'a','b', 'c'};
        if (x.equals(y)) {
            System.out.println("equals");
        }

    }

    public void m12() {
        System.out.println(0%3);
        System.out.println(1%3);
        System.out.println(2%4);
    }


}
